// OGoMojo
// Whitemice.MOGI.RPC2.IRPC2
// License: LGPL
// Copyright: Whitemice Consulting, 2006
// Author(s): Adam Tauno Williams (awilliam@whitemice.org)
using System;
using System.Net;
using System.Collections;
using CookComputing.XmlRpc;

namespace Whitemice.MOGI.RPC2 {

	public interface IRPC2
	{
		/// \brief Proxy for generic.getTypeById
    	[XmlRpcMethod("generic.getTypeById")]
    	string getTypeById(string primaryKey);
	
		/// \brief Proxy for System.getHostName
    	[XmlRpcMethod("system.getHostName")]
    	string getHostName();
                             
        /// \brief Proxy for system.getServerTimeZone                                                                       
    	[XmlRpcMethod("system.getServerTimeZone")]
    	string getServerTimeZone();
    	
    	/// \brief Determine access to object
    	[XmlRpcMethod("access.operationAllowedOnObjectsForAccess")]
    	bool OperationAllowed(string operation, string documentId, string actorId);
    	
    	/// \brief Set access to object
    	[XmlRpcMethod("access.setOperationOnObjectForAccess")]
    	bool SetOperationsAllowed(string operation, string documentId, string actorId);
                                        
        /// \brief Proxy for system.getServerTime                                                            
    	[XmlRpcMethod("system.getServerTime")]
    	DateTime getServerTime();
    	
    	/// \brief Proxy for account.getByNumber
    	[XmlRpcMethod("account.getByNumber")]
    	object GetAccountByNumber(string id);
    	
    	/// \brief Proxy for account.getTeamsForLogin
    	[XmlRpcMethod("account.getTeamsForLogin")]
    	Array GetAccountsTeams(string login);
    	
    	/// \brief Proxy for accout.getByLogin
    	[XmlRpcMethod("account.getByLogin")]
    	object GetAccountByLogin(string id);
    	
    	/// \brief Proxy for account.deleteByNumber
    	[XmlRpcMethod("account.deleteByNumber")]
    	bool DeleteAccountByNumber(string id);
    	
    	/// \brief Proxy for account.deleteByLogin
    	[XmlRpcMethod("account.deleteByLogin")]
    	XmlRpcStruct DeleteAccountByLogin(string id);
    	
    	/// \brief Proxy for account.getById
    	[XmlRpcMethod("account.getById")]
    	object GetAccountById(string id);
    	
    	[XmlRpcMethod("account.insert")]
    	XmlRpcStruct CreateAccount(XmlRpcStruct account);
    	
    	[XmlRpcMethod("account.update")]
    	XmlRpcStruct UpdateAccount(XmlRpcStruct account);
    	
    	/// \brief Proxy for account.getLoginAccount
    	[XmlRpcMethod("account.getLoginAccount")]
    	XmlRpcStruct GetCurrentAccount();
       
        /// \brief Proxy for account.getLoginAccountId
    	[XmlRpcMethod("account.getLoginAccountId")]
    	XmlRpcStruct GetCurrentAccountId();
    	
    	/// \brief Proxy for account.fetch
    	[XmlRpcMethod("account.fetch")]
    	Array GetAccounts(string fSpec);
    	
    	/// \brief Proxy for appointment.setParticipants
    	[XmlRpcMethod("appointment.setParticipants")]
    	XmlRpcStruct SetParticipants(string documentId, string[] participants);
    	
    	/// \brief Proxy for appointment.delete
    	[XmlRpcMethod("appointment.delete")]
		bool DeleteAppointment(string id);    	
    	///XmlRpcStruct DeleteAppointment(XmlRpcStruct appointment);
    	
    	/// \brief Proxy for appointment.fetchIds
    	[XmlRpcMethod("appointment.fetch")]
    	XmlRpcStruct[] AppointmentFetch(XmlRpcStruct fspec);
    	
    	/// \brief Proxy for appointment.getById
    	[XmlRpcMethod("appointment.getById")]
    	object GetAppointmentById(string id);
    	
    	/// \brief Proxy for appointment.insert
    	[XmlRpcMethod("appointment.insert")]
    	XmlRpcStruct CreateAppointment(XmlRpcStruct appointment);
    	
    	/// \brief Proxy for appointment.update
    	[XmlRpcMethod("appointment.update")]
    	XmlRpcStruct UpdateAppointment(XmlRpcStruct appointment);
    	
    	/// \brief Proxy for appointment.getOverview
    	[XmlRpcMethod("appointment.fetchOverview")]
    	XmlRpcStruct[] GetOverview(DateTime start, DateTime end);
    	
    	/// \brief Proxy for enterprise.getByNumber 
    	[XmlRpcMethod("enterprise.getByNumber")]
    	object GetEnterpriseByNumber(string id);
    	
    	/// \brief Proxy for enterprise.fetch
    	[XmlRpcMethod("enterprise.fetch")]
    	Array EnterpriseFetch(XmlRpcStruct fetchSpec);    	

		/// \brief Proxy for enterprise.getPersons
    	[XmlRpcMethod("enterprise.getPersons")]
    	object GetEnterpriseContacts(string id);
    	
		/// \brief Proxy for enterprise.getProjects
    	[XmlRpcMethod("enterprise.getProjects")]
    	Array GetEnterpriseProjects(string id);
    	
		/// \brief Proxy for enterprise.insert
    	[XmlRpcMethod("enterprise.insert")]
    	int CreateEnterprise(XmlRpcStruct enterprise);

		/// \brief Proxy for enterprise.update
    	[XmlRpcMethod("enterprise.update")]
    	XmlRpcStruct UpdateEnterprise(XmlRpcStruct enterprise);

		/// \brief Proxy for enterprise.delete
    	[XmlRpcMethod("enterprise.deleteByNumber")]
    	void RemoveEnterpriseByNumber(string id);

		/// \brief Proxy for enterprise.delete
    	[XmlRpcMethod("enterprise.delete")]
    	void RemoveEnterprise(int id);

		/// \brief Proxy for enterprise.deletePerson
   		[XmlRpcMethod("enterprise.deletePerson")]
    	void DisassociateContactFromEnterprise(string entepriseId, string personId);

		/// \brief Proxy for enterprise.getById
    	[XmlRpcMethod("enterprise.getById")]
    	object GetEnterpriseById(int id);

		/// \brief Proxy for enterprise.insertPerson
    	[XmlRpcMethod("enterprise.insertPerson")]
    	void AssociateContactWithEnterprise(string enterpriseId, string personId);
    	
    	///
    	/// Jobs
    	///
    	[XmlRpcMethod("person.insertJob")]
    	XmlRpcStruct CreateJob(XmlRpcStruct person, XmlRpcStruct task);
    	
    	[XmlRpcMethod("person.updateJob")]
    	XmlRpcStruct UpdateJob(XmlRpcStruct person, XmlRpcStruct task);
    	
    	[XmlRpcMethod("jobs.markDone")]
    	bool MarkJobDone(string id, string comment);
    	
    	[XmlRpcMethod("jobs.archiveJob")]
    	bool ArchiveJob(string id, string comment);
    	
    	[XmlRpcMethod("jobs.acceptJob")]
    	bool AcceptJob(string id, string comment);
    	
    	[XmlRpcMethod("jobs.annotateJob")]
    	bool AnnotateJob(string id, string comment);
    	
    	[XmlRpcMethod("jobs.RejectJob")]
    	bool RejectJob(string id, string comment);
    	
    	[XmlRpcMethod("jobs.reactivateJob")]
    	bool ReactivateJob(string id, string comment);
    	
    	[XmlRpcMethod("jobs.getToDoList")]
    	Array GetToDoList();
    	
    	[XmlRpcMethod("jobs.getDelegatedJobs")]
    	Array GetDelegatedJobs();
    	
    	[XmlRpcMethod("jobs.getArchivedJobs")]
    	Array GetArchivedJobs();
    	
    	[XmlRpcMethod("jobs.getJobs")]
    	Array GetJobsById(string[] jobsIds);

    	[XmlRpcMethod("person.fetchJobs")]
    	Array GetJobs(XmlRpcStruct person, XmlRpcStruct fetchSpec);
    	
    	[XmlRpcMethod("jobs.getHistory")]
    	Array GetJobHistory(string jobId);
    	
    	[XmlRpcMethod("jobs.assignToProject")]
    	bool AssociateJobToProject(string jobId, string projectId, string message);
    	
    	[XmlRpcMethod("jobs.detachFromProject")]
    	bool DisassociateJobFromProject(string jobId, string message);
    	
    	[XmlRpcMethod("person.deleteJob")]
    	bool DeleteJob(XmlRpcStruct person, string jobId);
    	
    	///
    	/// Person
    	///
    	///[XmlRpcMethod("person.getProject")]
    	[XmlRpcBegin("person.getProject")]
    	Array GetProjectsAssociatedWithContact(int personId);
    	
    	[XmlRpcMethod("person.fetch")]
    	Array ContactFetch(XmlRpcStruct fetchSpec);
    	
    	[XmlRpcMethod("person.getById")]
    	object GetContactById(int id);
    	
    	[XmlRpcMethod("person.insert")]
    	int CreateContact(XmlRpcStruct document);

    	[XmlRpcMethod("person.update")]
    	XmlRpcStruct UpdateContact(XmlRpcStruct document);
    	
    	[XmlRpcMethod("person.delete")]
    	void DeleteContact(string id);
    	
    	[XmlRpcMethod("person.fetchEnterprises")]
    	Array GetContactEnterprises(string id);

    	
    	///
    	/// Team
    	///
    	[XmlRpcMethod("team.getByNumber")]
    	XmlRpcStruct GetTeamByNumber(string number);
    	
    	[XmlRpcMethod("team.getMembersForTeam")]
    	Array GetTeamMembers(string number);
    	
    	[XmlRpcMethod("team.getByLogin")]
    	XmlRpcStruct GetTeamByLogin(string login);
    	
    	[XmlRpcMethod("team.getTeams")]
    	Array GetTeams();
    	
    	[XmlRpcMethod("team.insert")]
    	XmlRpcStruct CreateTeam(XmlRpcStruct team);
    	
    	[XmlRpcMethod("team.setMembers")]
    	bool SetTeamMembership(string number, Array members);
    	
    	///
    	/// Resources
    	///
    	[XmlRpcMethod("resource.getById")]
    	object GetResourceById(string id);
    	
    	[XmlRpcMethod("resource.categories")]
    	string[] GetResourceCategories();
    	
    	[XmlRpcMethod("resource.categories")]
    	Array GetResourcesByCategory(string category);
    	
    	[XmlRpcMethod("resource.getByName")]
    	Array GetResourceByName(string name);
    	
    	[XmlRpcMethod("resource.fetch")]
    	Array GetResources(XmlRpcStruct fSpec);
    	
    	[XmlRpcMethod("resource.update")]
    	XmlRpcStruct UpdateResource(XmlRpcStruct document);
    	
    	[XmlRpcMethod("resource.insert")]
    	string CreateResource(XmlRpcStruct document);
    	
    	[XmlRpcMethod("resource.delete")]
    	bool DeleteResource(string id);
    	
    	[XmlRpcMethod("link.getLinksFrom")]
    	object GetLinksFrom(string id);
	}
}
